<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!-- <h4>分类标题</h4> -->
	    <div class="row">
	      <div class="col-md-12 layout-header">
	        <button id="addBtn_TMmPrdgrItem" type="button" class="btn btn-default">添加</button>
	        <button id="delBtn_TMmPrdgrItem" type="button" class="btn btn-default">删除</button>
	        <script type="text/javascript"> 
			$('#addBtn_TMmPrdgrItem').bind('click', function(){   
		 		 var tr =  $("#add_tMmPrdgrItem_table_template tr").clone();
			 	 $("#add_tMmPrdgrItem_table").append(tr);
			 	 resetTrNum('add_tMmPrdgrItem_table');
			 	 return false;
		    });  
			$('#delBtn_TMmPrdgrItem').bind('click', function(){   
		       $("#add_tMmPrdgrItem_table").find("input:checked").parent().parent().remove();   
		        resetTrNum('add_tMmPrdgrItem_table');
		        return false;
		    });
		    $(document).ready(function(){
		    	if(location.href.indexOf("load=detail")!=-1){
					$(":input").attr("disabled","true");
					$(".datagrid-toolbar").hide();
				}
		    	resetTrNum('add_tMmPrdgrItem_table');
		    });
		</script>
	      </div>
	    </div>
<div style="margin: 0 15px; background-color: white;">    
	    <!-- Table -->
      <table id="tMmPrdgrItem_table" class="table table-bordered table-hover" style="margin-bottom: 0;">
		<thead>
	      <tr>
	        <th style="white-space:nowrap;width:50px;">序号</th>
	        <th style="white-space:nowrap;width:50px;">操作</th>
					  <th>
							生产订单号
					  </th>
					  <th>
							商品编码
					  </th>
					  <th>
							商品描述
					  </th>
					  <th>
							数量
					  </th>
					  <th>
							单位
					  </th>
					  <th>
							批次
					  </th>
					  <th>
							生产日期
					  </th>
					  <th>
							仓库编码
					  </th>
					  <th>
							仓库名称
					  </th>
					  <th>
							文本
					  </th>
	      </tr>
	    </thead>
        
	<tbody id="add_tMmPrdgrItem_table">	
	<c:if test="${fn:length(tMmPrdgrItemList)  <= 0 }">
			<tr>
				<th scope="row"><div name="xh"></div></th>
				<td><input style="width:20px;" type="checkbox" name="ck"/></td>
					<input name="tMmPrdgrItemList[0].id" type="hidden"/>
					<input name="tMmPrdgrItemList[0].createName" type="hidden"/>
					<input name="tMmPrdgrItemList[0].createBy" type="hidden"/>
					<input name="tMmPrdgrItemList[0].createDate" type="hidden"/>
					<input name="tMmPrdgrItemList[0].updateName" type="hidden"/>
					<input name="tMmPrdgrItemList[0].updateBy" type="hidden"/>
					<input name="tMmPrdgrItemList[0].updateDate" type="hidden"/>
					<input name="tMmPrdgrItemList[0].sysOrgCode" type="hidden"/>
					<input name="tMmPrdgrItemList[0].sysCompanyCode" type="hidden"/>
					<input name="tMmPrdgrItemList[0].bpmStatus" type="hidden"/>
					<input name="tMmPrdgrItemList[0].prdgrid" type="hidden"/>
				  <td>
					  	<input name="tMmPrdgrItemList[0].prdorder" maxlength="32" type="text" class="form-control"  style="width:120px;"  ignore="ignore" />
					  <label class="Validform_label" style="display: none;">生产订单号</label>
					</td>
				  <td>
						<input  id="tMmPrdgrItemList[0].matcode" name="tMmPrdgrItemList[0].matcode" type="text" style="width: 150px" class="form-control"  value="${poVal.matcode }"  ignore="ignore"  onclick="popupClick(this,'matcode,matname,unit','matcode,matname,unit','pop_material')"/> 			 
					  <label class="Validform_label" style="display: none;">商品编码</label>
					</td>
				  <td>
					  	<input name="tMmPrdgrItemList[0].matname" maxlength="100" type="text" class="form-control"  style="width:120px;"  ignore="ignore" />
					  <label class="Validform_label" style="display: none;">商品描述</label>
					</td>
				  <td>
					  	<input name="tMmPrdgrItemList[0].quantity" maxlength="32" type="text" class="form-control"  style="width:120px;"  ignore="ignore" />
					  <label class="Validform_label" style="display: none;">数量</label>
					</td>
				  <td>
					  	<input name="tMmPrdgrItemList[0].unit" maxlength="32" type="text" class="form-control"  style="width:120px;"  ignore="ignore" />
					  <label class="Validform_label" style="display: none;">单位</label>
					</td>
				  <td>
					  	<input name="tMmPrdgrItemList[0].batch" maxlength="32" type="text" class="form-control"  style="width:120px;"  ignore="ignore" />
					  <label class="Validform_label" style="display: none;">批次</label>
					</td>
				  <td>
						<input name="tMmPrdgrItemList[0].scrq" maxlength="32" type="text" class="form-control" onClick="WdatePicker()"  style="background: url('plug-in/ace/images/datetime.png') no-repeat scroll right center transparent;width:160px;"  ignore="ignore" />
					  <label class="Validform_label" style="display: none;">生产日期</label>
					</td>
				  <td>
						<input  id="tMmPrdgrItemList[0].locationcode" name="tMmPrdgrItemList[0].locationcode" type="text" style="width: 150px" class="form-control"  value="${poVal.locationcode }"  ignore="ignore"  onclick="popupClick(this,'locationcode,locationname','locationcode,locationname','pop_location')"/> 			 
					  <label class="Validform_label" style="display: none;">仓库编码</label>
					</td>
				  <td>
					  	<input name="tMmPrdgrItemList[0].locationname" maxlength="32" type="text" class="form-control"  style="width:120px;"  ignore="ignore" />
					  <label class="Validform_label" style="display: none;">仓库名称</label>
					</td>
				  <td>
					  	<input name="tMmPrdgrItemList[0].text" maxlength="100" type="text" class="form-control"  style="width:120px;"  ignore="ignore" />
					  <label class="Validform_label" style="display: none;">文本</label>
					</td>
   			</tr>
	</c:if>
	<c:if test="${fn:length(tMmPrdgrItemList)  > 0 }">
		<c:forEach items="${tMmPrdgrItemList}" var="poVal" varStatus="stuts">
			<tr>
				<th scope="row"><div name="xh">${stuts.index+1 }</div></th>
				<td><input style="width:20px;" type="checkbox" name="ck"/></td>
					<input name="tMmPrdgrItemList[${stuts.index }].id" type="hidden" value="${poVal.id }"/>
					<input name="tMmPrdgrItemList[${stuts.index }].createName" type="hidden" value="${poVal.createName }"/>
					<input name="tMmPrdgrItemList[${stuts.index }].createBy" type="hidden" value="${poVal.createBy }"/>
					<input name="tMmPrdgrItemList[${stuts.index }].createDate" type="hidden" value="${poVal.createDate }"/>
					<input name="tMmPrdgrItemList[${stuts.index }].updateName" type="hidden" value="${poVal.updateName }"/>
					<input name="tMmPrdgrItemList[${stuts.index }].updateBy" type="hidden" value="${poVal.updateBy }"/>
					<input name="tMmPrdgrItemList[${stuts.index }].updateDate" type="hidden" value="${poVal.updateDate }"/>
					<input name="tMmPrdgrItemList[${stuts.index }].sysOrgCode" type="hidden" value="${poVal.sysOrgCode }"/>
					<input name="tMmPrdgrItemList[${stuts.index }].sysCompanyCode" type="hidden" value="${poVal.sysCompanyCode }"/>
					<input name="tMmPrdgrItemList[${stuts.index }].bpmStatus" type="hidden" value="${poVal.bpmStatus }"/>
					<input name="tMmPrdgrItemList[${stuts.index }].prdgrid" type="hidden" value="${poVal.prdgrid }"/>
				   <td align="left">
					  	<input name="tMmPrdgrItemList[${stuts.index }].prdorder" maxlength="32" type="text" class="form-control"  style="width:120px;"  ignore="ignore"  value="${poVal.prdorder }"/>
					  <label class="Validform_label" style="display: none;">生产订单号</label>
				   </td>
				   <td align="left">
							<input  id="tMmPrdgrItemList[${stuts.index }].matcode" name="tMmPrdgrItemList[${stuts.index }].matcode"  type="text"  class="form-control"   ignore="ignore"   onclick="popupClick(this,'matcode,matname,unit','matcode,matname,unit','pop_material')"   value="${poVal.matcode }" /> 			 
					  <label class="Validform_label" style="display: none;">商品编码</label>
				   </td>
				   <td align="left">
					  	<input name="tMmPrdgrItemList[${stuts.index }].matname" maxlength="100" type="text" class="form-control"  style="width:120px;"  ignore="ignore"  value="${poVal.matname }"/>
					  <label class="Validform_label" style="display: none;">商品描述</label>
				   </td>
				   <td align="left">
					  	<input name="tMmPrdgrItemList[${stuts.index }].quantity" maxlength="32" type="text" class="form-control"  style="width:120px;"  ignore="ignore"  value="${poVal.quantity }"/>
					  <label class="Validform_label" style="display: none;">数量</label>
				   </td>
				   <td align="left">
					  	<input name="tMmPrdgrItemList[${stuts.index }].unit" maxlength="32" type="text" class="form-control"  style="width:120px;"  ignore="ignore"  value="${poVal.unit }"/>
					  <label class="Validform_label" style="display: none;">单位</label>
				   </td>
				   <td align="left">
					  	<input name="tMmPrdgrItemList[${stuts.index }].batch" maxlength="32" type="text" class="form-control"  style="width:120px;"  ignore="ignore"  value="${poVal.batch }"/>
					  <label class="Validform_label" style="display: none;">批次</label>
				   </td>
				   <td align="left">
							<input name="tMmPrdgrItemList[${stuts.index }].scrq" maxlength="32" type="text" class="form-control" onClick="WdatePicker()"  style="background: url('plug-in/ace/images/datetime.png') no-repeat scroll right center transparent;width:160px;"  ignore="ignore"  value="<fmt:formatDate value='${poVal.scrq}' type="date" pattern="yyyy-MM-dd"/>"/>
					  <label class="Validform_label" style="display: none;">生产日期</label>
				   </td>
				   <td align="left">
							<input  id="tMmPrdgrItemList[${stuts.index }].locationcode" name="tMmPrdgrItemList[${stuts.index }].locationcode"  type="text"  class="form-control"   ignore="ignore"   onclick="popupClick(this,'locationcode,locationname','locationcode,locationname','pop_location')"   value="${poVal.locationcode }" /> 			 
					  <label class="Validform_label" style="display: none;">仓库编码</label>
				   </td>
				   <td align="left">
					  	<input name="tMmPrdgrItemList[${stuts.index }].locationname" maxlength="32" type="text" class="form-control"  style="width:120px;"  ignore="ignore"  value="${poVal.locationname }"/>
					  <label class="Validform_label" style="display: none;">仓库名称</label>
				   </td>
				   <td align="left">
					  	<input name="tMmPrdgrItemList[${stuts.index }].text" maxlength="100" type="text" class="form-control"  style="width:120px;"  ignore="ignore"  value="${poVal.text }"/>
					  <label class="Validform_label" style="display: none;">文本</label>
				   </td>
   			</tr>
		</c:forEach>
	</c:if>	
	</tbody>
</table>
